package com.twenty.seven.security.sign.entity;

import com.twenty.seven.common.enums.StatusCode;

/**
 * @Author 001
 * @Date 2020/1/16 15:35
 * @TODO
 **/
public enum TripartiteCode {

    success("成功",1),
    fault("失败",2),
    paramError("参数错误",3);

    // 成员变量
    private String name;
    private int code;
    // 构造方法
    private TripartiteCode(String name, int code) {
        this.name = name;
        this.code = code;
    }
    // 普通方法
    public static String getName(int code) {
        for (TripartiteCode c : TripartiteCode.values()) {
            if (c.getCode() == code) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
}
